<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>添加</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <script src="../../../../lib/include.js"></script>
    <link rel="stylesheet" href="../../../../../../public-tools/pc/plugins/bootstrap-fileinput/css/fileinput.min.css">
    <link rel="stylesheet" href="../../../../../../public-tools/pc/plugins/bootstrap-select-1.12.4/css/bootstrap-select.min.css">

    <style>
        .form-control {
            margin-bottom: 8px;
        }

        .form-control:focus,
        .single-line:focus {
            border-color: #0e9aef !important;
        }

        .radio-inline {
            line-height: 5px;
        }
        .dropdown-menu.inner {
            background-color: #1ab394;
            color: white;
        }
        .dropdown-menu.open {
            border-radius: 5px;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content" id="app" v-cloak>

    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <form id="Form" autocomplete="off">
                <div style="padding: 0">
                    <!--班级-->
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-4">
                            <label class="form-inline">班级名称</label>
                            <div>
                                <input type="text" class="form-control" v-model="classVo.name" placeholder="请输入班级名称">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <!-- @click="setTimes" -->
                            <label class="form-inline">开班时间</label>
                            <div>
                                <input class="form-control time" name="classVo.beginTime" v-model="classVo.beginTime"
                                       onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',onpicked: setTimes})"
                                       placeholder="请选择开班时间" style="cursor: pointer">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">结班时间</label>
                            <div>
                                <input class="form-control time" name="classVo.endTime" v-model="classVo.endTime"
                                       onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',onpicked: setTimes})"
                                       placeholder="请选择结班时间" style="cursor: pointer">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-4">
                            <label class="form-inline">上课教室</label>
                            <div>
                                <select class="form-control" v-model="classVo.classRoom">
                                    <option v-for="item in classRoomList" :value="item.id">{{item.name}}</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">当前课时</label>
                            <div>
                                <input class="form-control" type="number" value="0" v-model="classVo.nowCourse" placeholder="请输入当前课时">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">总课时</label>
                            <div>
                                <input class="form-control" type="number" v-model="classVo.allCourse" placeholder="请输入总课时">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-12">
                            <label class="form-inline">上课教室详细地址</label>
                            <div>
                                <input class="form-control" type="text" v-model="classVo.addr" placeholder="请输入上课教室详细地址">
                            </div>
                        </div>
                    </div>
                    <!--课程-->
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-4">
                            <label class="form-inline">选择课程</label>
                            <div>
                                <select class="form-control" @change="selectCourse" v-model="courseAndClass.courseId">
                                    <option v-for="item in courseList" :value="item.id">{{item.name}}</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">课程名称</label>
                            <div>
                                <input class="form-control" disabled type="text" v-model="courseCopy.name" placeholder="请输入课程名称">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">适应人群</label>
                            <div>
                                <input class="form-control" disabled type="text" v-model="courseCopy.suit" placeholder="请输入适应人群">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-4">
                            <label class="form-inline">每期收费标准描述</label>
                            <div>
                                <input type="text" class="form-control" v-model="courseCopy.price" placeholder="请输入每期收费标准描述">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">开始报名时间</label>
                            <div>
                                <input class="form-control time" name="courseCopy.beginApply" v-model="courseCopy.beginApply"
                                       onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',onpicked: setTimes})"
                                       placeholder="请选择开始报名时间" style="cursor: pointer">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">结束报名时间</label>
                            <div>
                                <input class="form-control time" name="courseCopy.endApply" v-model="courseCopy.endApply"
                                       onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',onpicked: setTimes})"
                                       placeholder="请选择结束报名时间" style="cursor: pointer">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-4">
                            <label class="form-inline">是否开启试听</label>
                            <div>
                                <select v-model="courseCopy.isAudition" class="form-control">
                                    <option value="0">否</option>
                                    <option value="1">是</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">是否同步现有课程班进行试听</label>
                            <div>
                                <select v-model="courseCopy.isSynchro" class="form-control">
                                    <option value="0">否</option>
                                    <option value="1">是</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">小孩可试听次数</label>
                            <div>
                                <input class="form-control" type="number" value="0" v-model="courseCopy.studentAuditionNum" placeholder="请输入小孩可试听次数">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-3">
                            <label class="form-inline">当前期数</label>
                            <div>
                                <input class="form-control" type="number" value="0" v-model="courseCopy.stageNum" placeholder="请输入当前期数">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">总期数</label>
                            <div>
                                <input class="form-control" type="number" value="0" v-model="courseCopy.stageSumNum" placeholder="请输入总期数">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">状态</label>
                            <div>
                                <select v-model="courseCopy.status" class="form-control">
                                    <option value="0">待开班</option>
                                    <option value="1">上课中</option>
                                    <option value="2">已结班</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">课程类别</label>
                            <div>
                                <select v-model="courseCopy.type" class="form-control">
                                    <option v-for="item in selects" :value="item.keyS">{{item.keyValue}}</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-12">
                            <label class="form-inline">课程标签</label>
                            <div>
                                <select class="selectpicker form-control" id="tags" multiple name="tags"
                                        data-actions-box="false" >
                                </select>
                            </div>
                        </div>
                    </div>
                    <!--关联-->
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-3">
                            <label class="form-inline">学校</label>
                            <div>
                                <select class="form-control" v-model="schoolId" >
                                    <option v-if="schoolId == ''" value="">---公用---</option>
                                    <option v-for="(value, key) in schoolList" :key="key" :value="key">{{value}}</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">排序</label>
                            <div>
                                <input class="form-control" type="number" value="0" v-model="courseCopy.sort" placeholder="请输入排序">
                            </div>
                        </div>
                    </div>
                    <!--老师选择-->
                    <div class="col-sm-12 ">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title" @click="getTeachers">选择老师</h3>
                            </div>
                            <div class="panel-body">
                                <div v-for="(item,index) in courseAndClassList" class="alert alert-warning alert-dismissible specs" role="alert" style="width: 44%;margin-right: 15px;display: inline-block;padding: 10px 35px 10px 10px;float: left">
                                    <button type="button" class="close">
                                        <span @click="delTeacher(index)">&times;</span>
                                    </button>
                                    <div class="input-group">
                                        <div class="input-group-addon">教师姓名</div>
                                        <select class="form-control" v-model="item.teacherId" :value="item.teacherId">
                                            <option v-for="item1 in teacherList" :value="item1.loginId">{{item1.name}}</option>
                                        </select>
                                        <div class="input-group-addon">任职类别</div>
                                        <select class="form-control" v-model="item.teacherType" :value="item.teacherType">
                                            <option value="0" selected>教师</option>
                                            <option value="1">助教</option>
                                            <option value="2">班主任</option>
                                        </select>
                                    </div>
                                </div>
                                <div @click="addTeacher" class="alert alert-warning alert-dismissible" role="alert" style="font-size: 38px;display: inline-block;padding: 0px 14px;float: left;cursor: pointer;font-weight: bold;">
                                    +
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--课程规格-->
                    <div class="col-sm-12 ">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title" @click="getSpecList">课程规格配置</h3>
                            </div>
                            <div class="panel-body">
                                <div v-for="(item,index) in specList" class="alert alert-warning alert-dismissible specs" role="alert" style="width: 100%;display: inline-block;padding: 10px 35px 10px 10px">
                                    <button type="button" class="close">
                                        <span @click="delSpec(index)">&times;</span>
                                    </button>
                                    <div class="input-group">
                                        <div class="input-group-addon">原价</div>
                                        <input class="form-control ticket-oldPrice" min="0" oninput="value=value.replace(/[^\d(\.\d{1,2})]/g,'')" :value="item.oldPrice" v-model="item.oldPrice" @input="minValue(index,3)" type="number" placeholder="请输入费用">
                                        <div class="input-group-addon">元</div>
                                        <div class="input-group-addon">现价</div>
                                        <input class="form-control ticket-price" min="0" oninput="value=value.replace(/[^\d(\.\d{1,2})]/g,'')" :value="item.price" v-model="item.price" @input="minValue(index,1)" type="number" placeholder="请输入费用">
                                        <div class="input-group-addon">元</div>
<!--                                        <div class="input-group-addon">预付款</div>-->
<!--                                        <input class="form-control ticket-prePrice" min="0" oninput="value=value.replace(/[^\d(\.\d{1,2})]/g,'')" v-model="item.prePrice" @input="minValue(index,4)" type="number" placeholder="请输入费用">-->
<!--                                        <div class="input-group-addon">元</div>-->
                                        <div class="input-group-addon">单位</div>
                                        <input class="form-control ticket-price" :value="item.unitName" v-model="item.unitName" name="unitName" style="width: 120px" type="text" placeholder="单位名称(月,学期,学年,学年)">
                                        <div class="input-group-addon">课时</div>
                                        <input class="form-control ticket-price" min="0" :value="item.lessonNum" v-model="item.lessonNum" name="lessonNum" style="width: 100px" type="number" placeholder="上课课时">
                                        <div class="input-group-addon">招生人数</div>
                                        <input class="form-control ticket-amount" min="0" oninput="value=value.replace(/[^\d]/g,'')" :value="item.allAmount" v-model="item.allAmount" type="number" placeholder="请输入数量">

                                    </div>
                                </div>
                                <div @click="addSpec" class="alert alert-warning alert-dismissible" role="alert" style="font-size: 32px;display: inline-block;padding: 0px;cursor: pointer;width: 100%;text-align: center;font-weight: bold;">
                                    +
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div style="text-align: center">
                    <a href="javascript:parent.layer.closeAll();" class="btn btn-default" style="width: 10%;">关 闭</a>
                    <button type="submit" class="btn btn-primary" style="width: 10%;" v-if="permission(0)">保存</button>
                    <button type="submit" class="btn btn-primary" style="width: 10%;" v-else="permission(1)">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="../../../../../../public-tools/pc/plugins/wangEditor/wangEditor-video.js"></script>
<script src="../../../../../../public-tools/pc/plugins/bootstrap-fileinput/js/fileinput.js"></script>
<script src="../../../../../../public-tools/pc/plugins/bootstrap-select-1.12.4/js/bootstrap-select.min.js"></script>
<script src="../../../../../../public-tools/pc/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="../../../../js/teach-manage/class/class/edit.js"></script>
</body>
</html>

